package com.tmy.controller;

import com.tmy.Dto.Result;
import com.tmy.entity.Comment;
import com.tmy.service.CommentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 评论信息管理
 */
@RestController
@RequestMapping("/comment")
public class CommentController {
    @Resource
    private CommentService commentService;

    /**
     * 添加评论
     */
    @PostMapping("/addComment")
     public Result addComment(@RequestBody Comment comment){
         return commentService.addComment(comment);
     }

    /**
     * 查询评论
     */
    @PostMapping("/queryComment")
    public Result queryComment(@RequestBody Comment comment){
        return commentService.queryComment(comment);
    }
}
